import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class ListViewBuilderLn extends StatefulWidget {
  const ListViewBuilderLn({super.key});

  @override
  State<ListViewBuilderLn> createState() => _ListViewBuilderLnState();
}

class _ListViewBuilderLnState extends State<ListViewBuilderLn> {
  // String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(
            "ListView", // 设置标题文本
            style: TextStyle(
              color: Colors.white, // 设置标题字体颜色
            ),
          ),
          iconTheme: IconThemeData(
            color: Colors.white, // 设置返回图标颜色
          ),
          backgroundColor: Colors.deepPurple, // 设置AppBar背景颜色
        ),
        body: ListView.builder(
            itemCount: 100,
            itemExtent: 50.0, //强制高度为50.0
            itemBuilder: (BuildContext context, int index) {
              return ListTile(title: Text("$index"));
            }));
  }
}
